<!DOCTYPE html>
<html lang="en">
<head>
    <meta  http-equiv="content-type" content="text/html" charset="UTF-8" />
    <title>Document</title>
    <link rel="stylesheet" href="\mvc\static\css\list.css">
    <link rel="stylesheet" href="\mvc\static\css\style.css">
    <script src='http://cdn.bootcss.com/jquery/3.1.1/jquery.min.js'></script>
    <script>
        function check()
        {
            q = $('#name').val();
            if(q.length>12)
            {
                window.alert('课程字数不符合要求');
            }
        }
        function checkj()
        {
            q = $('#intro').val();
            if(q.length>25)
            {
                window.alert('简介字数不符合要求');
            }
            return false;
        }
        function  checkprice()
        {
            q = $('#price').val();
            if(q == '')
            {
                window.alert('价格不能为空');
            }
        }
        function zhuandao()
        {
            location.href="http://localhost/mvc/index.php/ListController/listt";                       //页面的直接跳转
        }
    </script>
</head>
<body>
<!-- 头部 -->
<header class="header">
    <div class="logo"></div>
    <a href="http://localhost/mvc/index.php/FabuController/fabu" class="nav__item nav__course">添加课程</a>
    <a href="http://localhost/mvc/index.php/ListController/listt" class="nav__item nav__item_icon_new">课程列表</i></a>
    <a href="http://localhost/mvc/index.php/ShoppingController/shopping" class="nav__item">购物车</a>
</header>
<div id="main">
    <form name="biaodan" method="post" action="/mvc/index.php/FabuController/fabuchuli">
    <div class="wrap">
    </div>
    <div class="container">
        <fieldset>
            <legend>发布课程:</legend><div class="control-group">
            <div class="control-group">
                <label class="control-label">课程名称</label>
                <div class="controls">
                    <input type="text" name="name" class="span4" required  id="name" placeholder="字数不能大于12" onblur="check()" />

                </div>
            </div>
            <div class="control-group">
                <label class="control-label">课程价格</label>
                <div class="controls">
                    <form name="biaodan" method="post">
                    <input type="text" name="price" class="span4" required  id="price"/>
                        </form>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" >所属方向</label>
                <div class="controls">
                    <select name="type">
                        <option>Php</option>
                        <option>Java</option>
                        <option>Html/css</option>
                        <option>Python</option>
                        <option>Android</option>
                        <option>Ios</option>
                    </select>

                </div>
            </div>
            <div class="control-group">
                <label class="control-label" >课程简介</label>
                <div class="controls">
                    <textarea name="content" rows="10" class="span8" required id="intro"  placeholder="字数不能大于25" onblur="checkj()"></textarea>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label" >课程级别</label>
                <div class="controls">
                    <select name="level">
                        <option>初级</option>
                        <option>中级</option>
                        <option>高级</option>
                    </select>

                </div>
            </div>
            <div class="control-group">


                  <input type="submit" class="btn btn-primary" type="" name="pubMsg" onclick="checkprice()" value="添加课程">
                <button class="btn btn-primary" name="1" onclick="zhuandao()">课程列表</button>

                </div>

    </div>
        </fieldset>
    </div>
        </form>
</div>
</body>
</html>